<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
<title>出入库信息管理</title>
<meta name="decorator" content="default" />
<script src="${ctxStatic}/common/format/formatOrderData.js"></script>
<script src="${ctxStatic}/js/LodopFuncs.js"></script>
<script type="text/javascript">
	$(function() {
		$("#btnPrint").click(function(){
			window.open("${ctx}/order/bsVaccineOrder/print?id=${bsVaccineOrder.id}", "_blank");
		});
	});
</script>
</head>
<body>
	<ul class="nav nav-tabs">
		<li class="active"><a>疫苗订单信息</a></li>
	</ul>
	<form:form id="inputForm" modelAttribute="bsVaccineOrder"
		action="${ctx}/order/bsVaccineOrder/veiwForm?id=${bsVaccineOrder.id}" method="post"
		class="form-horizontal">
		<form:hidden path="id" />
		<input id="receiveorgcode" type="hidden" name="receiveorgcode" value="${bsVaccineOrder.receiveorgcode}">
		<input id="payDate" type="hidden" name="payDate" value="${bsVaccineOrder.payDate}">
		<input id="payment" type="hidden" name="payment" value="${bsVaccineOrder.payment}">
		<sys:message content="${message}" />
		<div class="row-fluid">
			<div class="control-group span6">
				<label class="control-label">订单号：</label>
				<div class="controls">
					<form:input path="orderNo" htmlEscape="false" maxlength="50"
						readonly="true" class="span6" />
				</div>
			</div>
			<div class="control-group span6">
				<label class="control-label">订单状态：</label>
				<div class="controls">
					<form:select path="orderStatus"  readonly="true" disabled="true" class="span6 required ordertype">
						<form:options items="${fns:getDictList('bs_order_status')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
					</form:select>
				</div>
			</div>
		</div>
		<div class="row-fluid">
			<div class="control-group span6">
				<label class="control-label">出库日期：</label>
				<div class="controls">
					<input name="outboundDate" type="text" maxlength="20" class="span6 Wdate required"
						<c:if test="${bsVaccineOrder.createcode==office&&bsVaccineOrder.orderStatus!=11&&bsVaccineOrder.orderType==1}">
							 disabled readonly="readonly" 
						</c:if>
						<c:if test="${bsVaccineOrder.createcode==office&&bsVaccineOrder.orderStatus!=1&&bsVaccineOrder.orderType!=1}">
							 disabled readonly="readonly" 
						</c:if>
						value="<fmt:formatDate value="${bsVaccineOrder.outboundDate}" pattern="yyyy-MM-dd"/>"
						onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:true});" />
				</div>
			</div>
			<div class="control-group span6">
				<label class="control-label">类型：</label>
				<div class="controls">
					<form:select path="orderType"  readonly="true" disabled="true" class="span6 required ordertype">
						<form:options items="${fns:getDictList('bs_order_ordertype')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
					</form:select>
				</div>
			</div>
		</div>
		<c:if test="${bsVaccineOrder.orderType ==4}">
		<div class="row-fluid">
			<div class="control-group span6">
				<label class="control-label">使用单位：</label>
				<div class="controls">
					<form:input path="supplyorgName" htmlEscape="false"
						maxlength="255" readonly="true" class="span6 required" />
				</div>
			</div>
			<div class="control-group span6">
				<label class="control-label">填报人：</label>
				<div class="controls">
					<form:input path="consignorName" htmlEscape="false" maxlength="50"
						readonly="true" class="span6 required" />
				</div>
			</div>
		</div>
		</c:if>
		<c:if test="${bsVaccineOrder.orderType ==1 || bsVaccineOrder.orderType ==3 || bsVaccineOrder.orderType ==5}">
		<div class="row-fluid">
			<div class="control-group span6">
				<label class="control-label">供货单位：</label>
				<div class="controls">
					<form:input path="supplyorgName" htmlEscape="false"
						maxlength="255" readonly="true" class="span6 required" />
				</div>
			</div>
			<div class="control-group span6">
				<label class="control-label">供货单位经手人：</label>
				<div class="controls">
					<form:input path="consignorName" htmlEscape="false" maxlength="50"
						readonly="true" class="span6 required" />
				</div>
			</div>
		</div>
		<div class="row-fluid">
			<div class="control-group span6">
				<label class="control-label">收货单位：</label>
				<div class="controls">
					<form:input path="receiveorgName" htmlEscape="false"
						readonly="true" maxlength="255" class="span6 receive required" />
				</div>
			</div>
			<div class="control-group span6">
				<label class="control-label">收货单位经手人：</label>
				<div class="controls">
					<form:input path="consigneeName" htmlEscape="false" maxlength="50"
						readonly="true" class="span6" />
				</div>
			</div>
		</div>
		<div class="row-fluid ">
			<div class="control-group span6">
				<label class="control-label">疫苗运输工具：</label>
				<div class="controls">
					<form:radiobuttons path="transportation" readonly="true"
						disabled="true"
						items="${fns:getDictList('bs_order_transportation')}"
						itemLabel="label" itemValue="value" class="required trantype" />
					<form:input path="otherTransportation" readonly="true"
						htmlEscape="false" maxlength="50" class="input-mini traninput" />
				</div>
			</div>
			<div class="control-group span6">
				<label class="control-label">疫苗冷藏方式：</label>
				<div class="controls">
					<form:radiobuttons path="refrigeratetype" readonly="true"
						disabled="true"
						items="${fns:getDictList('bs_order_refrigeratetype')}"
						itemLabel="label" itemValue="value" class="required reftype" />
					<form:input path="otherRefrigeratetype" readonly="true"
						htmlEscape="false" maxlength="50" class="input-mini refinput" />
				</div>
			</div>
		</div>
		</c:if>
		<div class="row-fluid">
			<div class="control-group span6">
				<label class="control-label">疫苗类型：</label>
				<div class="controls">
					<form:radiobuttons path="cType" readonly="true" disabled="true"
						items="${fns:getDictList('bs_vaccine_type')}"
						itemLabel="label" itemValue="value" class="required reftype" />
				</div>
			</div>
		</div>
		<div class="row-fluid">
			<div class="control-group span12">
				<label class="control-label">备注信息：</label>
				<div class="controls">
					<form:textarea path="remarks" htmlEscape="false" rows="3"
						readonly="true" style="width: 78%;resize: vertical;"
						maxlength="255" class="input-xlarge" />
				</div>
			</div>
		</div>
		<div class="control-group table">
			<table id="tab" class="table  table-bordered table-condensed">
				<thead>
					<tr>
						<th>疫苗名称/注射器类型</th>
						<th>疫苗属性</th>
						<th>疫苗生产企业</th>
						<th>批号</th>
						<th>规格(剂/支或粒)</th>
						<th>剂量</th>
						<th>有效日期</th>
						<th>数量</th>
						<th>出库价</th>
						<th>成本价</th>
					</tr>
				</thead>
				<tbody id="check" class="table_content">
					<c:forEach items="${bsVaccineOrderDetailList}"
						var="bsVaccineOrderDetail">
						<tr>
							<td>${bsVaccineOrderDetail.name}</td>
							<td>${fns:getDictLabel(bsVaccineOrderDetail.sort, "bs_vaccine_type", "")}</td>
							<td>${bsVaccineOrderDetail.companyName}</td>
							<td>
								${bsVaccineOrderDetail.batchno}
								<c:if test="${not empty bsVaccineOrderDetail.secondBatchno}">
							        <span title="(查询批号时不需要带入亚批号)" style="color: #2fa4e7;"> -${bsVaccineOrderDetail.secondBatchno}</span>
							    </c:if>
							</td>
							<c:if test="${bsVaccineOrderDetail.batchType==2}">
								<td>${fns:getDictLabel(bsVaccineOrderDetail.spec, "syringe_spec", "")}</td>
							</c:if>
							<c:if test="${bsVaccineOrderDetail.batchType==1}">
								<td>${bsVaccineOrderDetail.spec}</td>
							</c:if>
							<td>${bsVaccineOrderDetail.dose}</td>
							<td>${bsVaccineOrderDetail.vaccExpDate}</td>
							<td>${bsVaccineOrderDetail.num}</td>
							<td>￥${bsVaccineOrderDetail.sellprice == null ? 0 : bsVaccineOrderDetail.sellprice}</td>
							<td>￥${bsVaccineOrderDetail.orignprice == null ? 0 : bsVaccineOrderDetail.orignprice}</td>
						</tr>
					</c:forEach>
				</tbody>
			</table>
		</div>
		<div class="form-actions">
			<button id="btnPrint" class="btn btn-primary" type="button" >打印</button>
			<button id="btnCancel" class="btn btn-primary" type="button" onclick="history.go(-1)">返 回</button>
			<div class="pull-right">
				<span style = "font-size: 15px;">成本总金额：${payment.SUMORIGNPRICE }	&nbsp;/	&nbsp;售价总金额：${payment.SUMSELLPRICE }	&nbsp;/	&nbsp;总数量：${payment.SUMVACCNUM }</span>
			</div>
			
		</div>
	</form:form>
</body>
</html>